import http from '@/utils/request'

// 添加购物项
export const addShoppingCartItemApi = (goodsId) => http.post('/shopping/' + goodsId)


// 删除购物项
export const deleteShoppingCartItemApi = (id) => http.delete('/shopping/' + id)

// 修改购物项中商品数量
export const updateGoodsCountApi = (data) => http.put('/shopping', data)

// 获取购物项列表
export const getShoppingCartItemListApi = (params) => http.get('/shopping')

// 获取购物车商品数量
export const getShoppingCartItemCountApi = () => http.get('/shopping/count')

// 获取选中的购物项
export const getSelectedItemsApi = (ids) => http.get('/shopping/selected', {
  params: {
    ids: ids
  }
})